<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>门诊发票报表管理</title>
<meta name="decorator" content="default"/>
<script src="${ctxStatic}/common/change/change.js"></script>
<style type="text/css">		
	#contentTable td ,#contentTable th{
		text-align: center;
		padding:1px 25px;
	}
	#contentTable {
	    padding:1px 4px;
	}
	.minWidth {
		min-width: 177px;
	}	
</style>
<script type="text/javascript">
$(document).ready(function() {
	initVaccName(bsChargeLogVaccList.companyCode,bsChargeLogVaccList.vaccCode);
	initVaccCompanyName(bsChargeLogVaccList.companyCode)
	$(".vaccineCompany").change(function(){
		var vaccId = $(this).val();
		initCompanyName($(this).val());
		if(vaccId == ""){
			initVaccCompanyName("");
		}
	});
	$("#btnReset").click(function(){
		$("#vaccCode").val("").select2();
		$("#companyCode").val("").select2();
		$("#vaccBatchnum").val("");
		$("#localCodeName").val("");
		$("#localCodeId").val("");
		$("#beginDate").val("");
		$("#endDate").val("");
	});
});
var bsChargeLogVaccList = JSON.parse('${fns:toJson(bsChargeLogVaccList)}');
function page(n,s){
	$("#pageNo").val(n);
	$("#pageSize").val(s);
	$("#searchForm").submit();
    return false;
}
function down(){
	top.$.jBox.confirm("确认导出发票分疫苗信息数据吗？","系统提示",function(v,h,f){
		if(v=="ok"){
			$("#searchForm").attr("action","${ctx}/chargelog/bsChargeLog/vaccCodeExport");
			$("#searchForm").submit();
			$("#searchForm").attr("action","${ctx}/chargelog/bsChargeLog/getVaccUse");
		}
	},{buttonsFocus:1});
	top.$('.jbox-body .jbox-icon').css('top','55px');
}
</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/chargelog/bsChargeLog/">发票统计</a></li>
		<li><a href="${ctx}/chargelog/bsChargeLog/chargeLogMoney">发票金额统计</a></li>
		<li class="active"><a href="${ctx}/chargelog/bsChargeLog/getVaccUse">发票分疫苗统计</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="bsChargeLogVaccList" action="${ctx}/chargelog/bsChargeLog/getVaccUse" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<table class="table table-bordered">
		   <tr>
		        <th>地区：</th>
				<td>
				    <sys:treeselect2 id="localCode" name="localCode" value="${bsChargeLogVaccList.localCode}" labelName="areaName" labelValue="${bsChargeLogVaccList.areaName}"
					title="机构" url="/sys/office/treeData" extId="${office.id}" cssClass="input-medium" allowClear="${office.currentUser.admin}" layer = "true"/>
					<%-- <form:input path="areaName"  htmlEscape="false" maxlength="255" readonly="true" class="span2 receive minWidth"/>
					<input id="add_receive" class="btn btn-primary btn-mini" type="button" value="选 择"/> --%>
				</td>
				<th>起始日期</th>
				<td>
					<input name="beginDate" id ="beginDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
						value="<fmt:formatDate value="${bsChargeLogVaccList.beginDate}" pattern="yyyy-MM-dd"/>"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
				</td>
				<th>截止日期</th>
				<td>
					<input name="endDate" id ="endDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
						value="<fmt:formatDate value="${bsChargeLogVaccList.endDate}" pattern="yyyy-MM-dd"/>"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
				</td>
			</tr>
			<tr>
				<th>疫苗名称:</th>
				<td>
					<form:select path="vaccCode" id="vaccCode" class="span2 minWidth vaccineCompany">
						<form:option value="" label="--请选择--"/>
					</form:select>
				</td>
				<th>生产企业：</th>
				<td>
					<form:select path="companyCode" id="companyCode" class="span2 minWidth changeCompany vaccCompanyName">
					    <form:option value="" label="--请选择--"/> 
					</form:select>
				</td>
				<th>批号：</th>
				<td>
					<form:input path="vaccBatchnum" id="vaccBatchnum" class="span2 minWidth"/>
				</td>
			</tr>
		</table>
		<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
		<input type="button" class="btn btn-primary"  id="btnReset" value="重置"/>
		<input onclick="down()" class="btn btn-primary" type="button" value="导出"/>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
			    <th>编号</th>
			    <th>归属区域</th>
			    <th>接种门诊</th>
			    <th>疫苗名称</th>
			    <th>生产厂商</th>
				<th>批号</th>
				<th>剂量</th>
				<th>疫苗单价</th>
				<th>使用数量</th>
				<th>总价</th>
				<th>支付方式</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="bsChargeLogVaccList" begin="0" varStatus="status">
			<tr data-localCode="${bsChargeLogVaccList.localCode}">
			    <td>
					${(page.pageNo-1)*page.pageSize+status.index+1 }
				</td>
				<td>
					${bsChargeLogVaccList.areaName}
				</td>
				<td>
					${bsChargeLogVaccList.department}
				</td>
				<td>
				    <c:if test="${not empty bsChargeLogVaccList.vaccName}">
					   ${bsChargeLogVaccList.vaccName}
				    </c:if>
				    <c:if test="${empty bsChargeLogVaccList.vaccName}">
					   无
				    </c:if>
				</td>
				<td>
					${bsChargeLogVaccList.vaccManufacturer}
				</td>
				<td>
					${bsChargeLogVaccList.vaccBatchnum}
				</td>
				<td>
					${bsChargeLogVaccList.vaccDose}
				</td>
				<td style = "text-align: right; padding-right: 10px">
					￥${bsChargeLogVaccList.vaccPrice}
				</td>
				<td>
					${bsChargeLogVaccList.vaccCount}
				</td>
				<td style = "text-align: right; padding-right: 10px">
					￥${bsChargeLogVaccList.sum}
				</td>
				<td>
					${fns:getDictLabel(bsChargeLogVaccList.paytype, 'payType', '') }
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>